package com.ruoyi.weiriya.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.ruoyi.weiriya.domain.WNonVipSetting;
import com.ruoyi.weiriya.domain.WOrder;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 用户支付订单Mapper接口
 * 
 * @author lynn
 * @date 2023-08-01
 */
public interface WOrderMapper extends BaseMapper<WOrder>
{

    @Select("SELECT o.*,a.name area_name, m.nick_name member_name FROM w_order o " +
            "LEFT JOIN w_area a on a.id = o.area_id " +
            "LEFT JOIN w_member m on m.id = o.member_id ${ew.customSqlSegment}")
    List<WOrder> getList(@Param(Constants.WRAPPER) QueryWrapper<WOrder> queryWrapper);

    @Select("SELECT o.*,a.name area_name, m.nick_name member_name FROM w_order o " +
            "LEFT JOIN w_area a on a.id = o.area_id " +
            "LEFT JOIN w_member m on m.id = o.member_id " +
            "WHERE o.id = #{id}")
    WOrder getWOrderById(String id);
}
